package com.ljh.bs.service;

import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.ljh.bs.dao.BookInfoMapper;

@Service
public class BookInfoBookInfoServiceImpl implements BookInfoService{
	/**
	 * 实例化  dao层
	 */
	@Autowired
	BookInfoMapper bookInfoMapper;//实例化dao
	
	@Override
	public List<Map<String, Object>> findAll(Map<String, Object> map) {
		return bookInfoMapper.findAll(map);
	}
	@Override
	public int count(Map<String, Object> map) {
		return bookInfoMaper.count(map);
	}
	@Override
	public int pageCount(Map<String, Object> map) {
		int count =bookInfoMapper.count(map);
		int indexSize = (Integer) map.get("indexSize");
		if(count%indexSize==0){
			return count/indexSize;
		}
		return count/indexSize+1;
	}
	

}
